{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Comparing Models With k-fold Cross-validation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Importing libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data preparation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# importing data\n",
    "data_path= '../data/diamonds.csv'\n",
    "diamonds = pd.read_csv(data_path)\n",
    "diamonds = pd.concat([diamonds, pd.get_dummies(diamonds['cut'], prefix='cut', drop_first=True)],axis=1)\n",
    "diamonds = pd.concat([diamonds, pd.get_dummies(diamonds['color'], prefix='color', drop_first=True)],axis=1)\n",
    "diamonds = pd.concat([diamonds, pd.get_dummies(diamonds['clarity'], prefix='clarity', drop_first=True)],axis=1)\n",
    "diamonds.drop(['cut','color','clarity'], axis=1, inplace=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Preparing objects for modelling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import RobustScaler\n",
    "target_name = 'price'\n",
    "robust_scaler = RobustScaler()\n",
    "X = diamonds.drop('price', axis=1)\n",
    "X = robust_scaler.fit_transform(X)\n",
    "y = diamonds[target_name]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Comparing 3 models using cross-validation scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.neighbors import KNeighborsRegressor\n",
    "from sklearn.ensemble import RandomForestRegressor\n",
    "from sklearn.ensemble import AdaBoostRegressor\n",
    "\n",
    "from sklearn.model_selection import cross_validate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "## KNN\n",
    "knn = KNeighborsRegressor(n_neighbors=20, weights='distance', metric='euclidean', n_jobs=-1)\n",
    "knn_test_mse = cross_validate(estimator=knn,X=X,y=y,\n",
    "                                    scoring='mean_squared_error', \n",
    "                                    cv=10, n_jobs=-1)['test_score']\n",
    "\n",
    "## Random Forests\n",
    "RF = RandomForestRegressor(n_estimators=50, max_depth=16, random_state=55, n_jobs=-1)\n",
    "RF_test_mse = cross_validate(estimator=RF,X=X,y=y,\n",
    "                                    scoring='mean_squared_error', \n",
    "                                    cv=10, n_jobs=-1)['test_score']\n",
    "\n",
    "## Boosting\n",
    "boosting = AdaBoostRegressor(n_estimators=50, learning_rate=0.05, random_state=55)  \n",
    "boosting_test_mse = cross_validate(estimator=boosting,X=X,y=y,\n",
    "                             scoring='mean_squared_error', \n",
    "                             cv=10, n_jobs=-1)['test_score']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "mse_models = -1*pd.DataFrame({'KNN':knn_test_mse,\n",
    "                           'RandomForest': RF_test_mse,\n",
    "                           'Boosting':boosting_test_mse})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Boosting</th>\n",
       "      <th>KNN</th>\n",
       "      <th>RandomForest</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.871637e+06</td>\n",
       "      <td>6.261917e+05</td>\n",
       "      <td>3.751482e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3.796796e+06</td>\n",
       "      <td>5.654357e+05</td>\n",
       "      <td>4.506298e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2.928736e+06</td>\n",
       "      <td>1.172655e+06</td>\n",
       "      <td>1.413179e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7.420615e+06</td>\n",
       "      <td>2.856918e+06</td>\n",
       "      <td>2.360007e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.004345e+07</td>\n",
       "      <td>1.346273e+07</td>\n",
       "      <td>5.753556e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3.616306e+06</td>\n",
       "      <td>3.056937e+06</td>\n",
       "      <td>1.351211e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>3.880890e+04</td>\n",
       "      <td>4.662510e+04</td>\n",
       "      <td>2.460778e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>5.167800e+05</td>\n",
       "      <td>1.218936e+05</td>\n",
       "      <td>6.391719e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>6.208819e+05</td>\n",
       "      <td>2.427801e+05</td>\n",
       "      <td>1.190176e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>6.810013e+05</td>\n",
       "      <td>4.797159e+05</td>\n",
       "      <td>1.917342e+05</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Boosting           KNN  RandomForest\n",
       "0  1.871637e+06  6.261917e+05  3.751482e+05\n",
       "1  3.796796e+06  5.654357e+05  4.506298e+05\n",
       "2  2.928736e+06  1.172655e+06  1.413179e+06\n",
       "3  7.420615e+06  2.856918e+06  2.360007e+06\n",
       "4  1.004345e+07  1.346273e+07  5.753556e+06\n",
       "5  3.616306e+06  3.056937e+06  1.351211e+06\n",
       "6  3.880890e+04  4.662510e+04  2.460778e+04\n",
       "7  5.167800e+05  1.218936e+05  6.391719e+04\n",
       "8  6.208819e+05  2.427801e+05  1.190176e+05\n",
       "9  6.810013e+05  4.797159e+05  1.917342e+05"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mse_models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAE/CAYAAADmGaF6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGydJREFUeJzt3Xm4ZVV95vHvSxUyCDIIYolKqY3aQRSwHFCDU8cg0FHU\nDqI2OCRo1OAcceiEJI+x1HYIrRGHqAFxTBxQ4xhxiiIWUkwKClIGUSaVEsQBil//sdelTl3uVNM6\nxb3fz/Ocp/ZZe++11l5n33ves/Y+t1JVSJIk9bLVuDsgSZIWFsOHJEnqyvAhSZK6MnxIkqSuDB+S\nJKkrw4ckSerK8CFpi5LkDUl+nmTVuPuyJUjyviR/Ne5+zFWS05M8bQ7bbZukkty5R7+0ZTF8SJMk\nWZXk90l2m1R+VvtlubRjX56a5Lr2+E2Sm0aeX7cR9d47yY2zbLO8He+zJ5W/vJUf154nyd+0cbsu\nyaVJTh7Z/vQkvx3td5KPTtPm3sBfAHtX1dINPb6R+ibe4H7d2v1JktclycbW3UtVPb2q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SVR9rxQvy/JhqLBbyuTGhqq4BTgMOZoGeG1MxfGx63wH2\nbncV34bhRqBTx9ynDZbktkl2nFgGHgOcx3BME3dRH81wjZdW/uR2J/bdgL2BM9pU46+SPLjdrX3U\npH0m6noS8OX2qeDzwGOS7NKmax/TysZtbMfe1p3Wtp3c/lhM/DJtDmc4P2Cej0fr+z8D36+qN42s\nWnDnx3RjsYDPjd2T7NyWt2O4/+UCFuC5Ma1x3Wwynx/AIQx3e18MvGrc/dnIY7k7w13YZwPnTxwP\nw/XD/wB+CHwJ2HVkn1e1Y7+Qdmd2K1/G8MvnYuCtrP0jd9sCHwUuYriz++4j+zyzlV8EPGMMx/9B\nhuniGxiukT5r3MfeXpMzWvlHgW3GPB4nA+cC5zD8QlyyEMYDeBjDtPk5wMr2OGQhnh8zjMVCPTfu\nC5zVjvs84K9b+YI7N6Z7+BdOJUlSV152kSRJXRk+JElSV4YPSZLUleFDkiR1ZfiQJEldGT4kSVJX\nhg9JktSV4UOSJHX1/wFlJaClDdl+IQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x14ed1187cf8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(8,5))\n",
    "mse_models.mean().sort_values().plot(kind='barh', ax=ax)\n",
    "ax.set_title('Mean Test MSE for Regression Models');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAecAAAE/CAYAAAB8YAsWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X2YZGV95//3xxlcuYSAG8is8jTENXHMID6MutmdmJ6w\nMaDJstlNVloTH3b8EX4r5MlkZXfyi3ol7ZIYo4tiyMQhyMYMMcY1KkQxm2mRVVck8miLOwEj4DMI\n2khkZvj+/jinTU0z3V0zc2r60PV+XVddU3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rQ8yUnAV6rqj4C303RCgF1JDtuP\nZtwKfH97TgaaQ0Nawarq2zQfXi9Osq8R9O8Dv8A+PkCr6h6aw50LjbzVM+37/YvAq9qQOgr4alXt\nas8Rn7TE8+8F7k2ysV304oHVH517nOQHgBNpPlMOxieBH01yTDvpa5LmiOF8twLHJvnhdvuHJfmh\nJI8CTqiqHcCraV7vEcC3aA6zrwgr7ttGD8wdaoLmm99Lq2pPkv8J/DBwA815lf9cVV9eZPlLgV9P\nsovmfOAEpR3+AAAA+klEQVTcyHkrcGOSv62qwf9E+1RVDyT5T8AHk9xPc7hcK1xV3ZPkdODqNH8B\nbnDd19t+t9DkrzcC5466jepOVX26PYw9SXOY+P1JbgI+RTP/ZSkvBy5JUsBVA8vfBvxBW9du4GVV\n9Z12rumBtvVLSc4HdtB8Rl5RVX+5j3IPJvkZ4MIkR9Hk1ZuBzwF/0i4LcGFV3Zvk/cC72wlw51XV\nRw+4kT3gFcLGQJIjqmq2Pfd9EfB/q+pNy90uSdK+eVh7PPw/7Wj+FppDQH+4zO2RJC3CkbMkST3j\nyFmSpJ4xnCVJ6hnDWZKknjGcJUnqGcNZkqSeMZwlSeqZ/x8P674Bpeo9RQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x14ed1187c50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(8,5))\n",
    "mse_models.boxplot(ax=ax)\n",
    "ax.set_title('Test MSE for Regression Models');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAE/CAYAAADmGaF6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH3dJREFUeJzt3XuYXVVh/vHvS4IQLgYQtOEiEa21AhUQbFFExFqBqK23\nItVH0LaWKuK1ivVS7PNo4xVK668Iar2hg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E/g4lr3rzz0R+o2rk/Uy+uTf6feNq+p5ZcD\nr16LcXyJbhr1Prrrj3857DHUY3tuLf8ysNFajufzwEXAhcBprPxCOmXHA+xDNyV8IbCkPg6a5udn\nrDFN13P0B8D5td8XA++dCq8D62A80/L89Lbfj4fCx7Q8NxN9+BdOJUlSU97zIUmSmjJ8SJKkpgwf\nkiSpKcOHJElqyvAhSZKaMnxIkqSmDB+SJKkpw4ckSWrq/wN2fOidzwEkGQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x14ed31d2358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(8,5))\n",
    "mse_models.std().sort_values().plot(kind='barh', ax=ax)\n",
    "ax.set_title('Standard Deviation of Test MSE for Regression Models');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Exercise: compare the 4 models used with the credit card default dataset using cross-validation, then pick the best one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
